package br.ufrj.dcc.xml.dynamicintervals.decoder;

import java.io.IOException;
import java.io.OutputStream;

/**
 * @author Alexandre Oliveira
 * This classes extends Decoder and outputs the result to a 
 * OutputStream.   
 */

public class OutputStreamDecoder extends Decoder {
	protected OutputStream out;
	
	public OutputStreamDecoder() {
		this(System.out);
	}
	
	public OutputStreamDecoder( OutputStream out ) {
		this.out = out;
	}
	
	@Override
	protected void print(String s) throws IOException {
		byte[] b = s.getBytes();
		out.write(b, 0, b.length);
	}

}
